import { ApiPropertyOptional, ApiProperty } from "@nestjs/swagger"
import { IsString, IsNotEmpty } from "class-validator"

export class CreateWebConfigDto {
  @ApiPropertyOptional({
    type: Number,
    name: 'id',
    description: 'id',
  })
  public readonly id: number

  @IsString({ message: '网站标题不是String类型' })
  @IsNotEmpty({ message: '网站标题不能为空' })
  @ApiProperty({
    type: String,
    name: 'title',
    description: '网站标题',
  })
  public readonly title: string
  /** 副标题 */
  @ApiPropertyOptional({
    type: String,
    name: 'subtitle',
    description: '副标题',
  })
  public readonly subtitle: string


  /** 作者 */
  @ApiPropertyOptional({
    type: String,
    name: 'author',
    description: '作者',
  })
  public readonly author: string

  /** 网站详情 */
  @ApiPropertyOptional({
    type: String,
    name: 'description',
    description: '网站详情',
  })
  public readonly description: string

  /** 关键字 */
  @ApiPropertyOptional({
    type: String,
    name: 'keywords',
    description: '关键字',
  })
  public readonly keywords: string

  /** 语言 */
  @ApiPropertyOptional({
    type: String,
    name: 'language',
    description: '语言',
  })
  public readonly language: string

}
